#!usr/bin/env python  
# -*- coding:utf-8 _*-
""" 
@author:robot
@file: case04_v52.py 
@version:
@time: 2022/05/13 
"""
from TapClientCaseData.CaseGenerateData import CaseGenerate01
from TapClientCaseData.CaseGenerateData.case_generator.case_data_generate_base import *
from TapDataSourceInfo import db_info_v152


class CaseGenerate52(CaseGenerate01):
    CGB_SOURCE_52 = read_yaml(path_joint(CASE_GENERATE_SOURCE, 'source52.yml'))
    CGB_TARGET_52 = read_yaml(path_joint(CASE_GENERATE_TARGET, 'target52.yml'))
    CGB_TARGET_24 = read_yaml(path_joint(CASE_GENERATE_TARGET, 'target01.yml'))
    CGB_TARGET_24.update(CGB_TARGET_52)
    CGB_TARGET = CGB_TARGET_24
    _CGBS_TIDB = CGB_SOURCE_52.get('TiDB')
    _CGBS_KUNDB = CGB_SOURCE_52.get('KunDB')
    # CASE DATA
    CGBS_TIDB = static_add_db_info_name(MYSQL_GENERATE_STATIC, _CGBS_TIDB)
    CGBS_KUNDB = static_add_db_info_name(MYSQL_GENERATE_STATIC, _CGBS_KUNDB)
    # db_info class
    db_info_class = get_classes(db_info_v152)

    def cgb_tidb(self, case='demo', _type='dataflow'):
        return self.assemble(self.CGBS_TIDB, case, _type)

    def cgb_kundb(self, case='demo', _type='dataflow'):
        return self.assemble(self.CGBS_KUNDB, case, _type)

